﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.lmpop.trade.shopcart.*"%>
<%@page import="com.lmpop.createIndex.search.MidNavIndexFiles"%>
<%@page import="com.lmpop.createIndex.search.SearchKeyIndexFiles"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>会员中心</title>
    <link  href="/templets/html/css/top.css"  rel="stylesheet" />
	<style type="text/css">
		#header {width: 100%; background-position:left;}
		#menu {width: 100%;background-position:left;}
		#top_rmsou {width: 100%;background-position:left;}
	</style>
  </head>
  
  <body>
<%
	Hashtable<String ,Hashtable<String ,Goods>> cartMap = null;
	CartServices top_shopcart = null;
	if(session.getAttribute("shoppingCart") != null) {
	  	top_shopcart = (CartServices) session.getAttribute("shoppingCart");
		cartMap = top_shopcart.getCartMap();
	} 
	
	String se_user_name = "",user_id = "",s_user_name = "";
	if(session.getAttribute("session_user_name")!=null){
		se_user_name = session.getAttribute("session_user_name").toString();
		s_user_name = session.getAttribute("session_user_name").toString();
		if(s_user_name.length()>8){s_user_name = se_user_name.substring(0,8);}
	} 
	if(session.getAttribute("session_user_id")!=null){
		user_id = session.getAttribute("session_user_id").toString();
	}
	
	
	int top_totalGoodsCount = 0;
	if(top_shopcart != null){
		top_totalGoodsCount = top_shopcart.getAllItemsCount();
	}
 
	MidNavIndexFiles midNavIndex = new MidNavIndexFiles();
 	Map conditionMap = new Hashtable();
	conditionMap.put("cust_id","100000000000000");
	conditionMap.put("ifshow","0");
	conditionMap.put("nav_post","1");
	List navList = midNavIndex.getMidNavInfo(conditionMap);
	SearchKeyIndexFiles searchKeyIndex = new SearchKeyIndexFiles();
 	Map conditionMapz = new Hashtable();
	conditionMapz.put("key_type","0");
	List keywordList = searchKeyIndex.getSearchKeyInfo(conditionMapz);

 %>

<div id="container" style="width:100%">
<div  id="header">
<div id="top_text" class="top">
<h1>
<% if((s_user_name==null ||"".equals(s_user_name))){ %>
<a href="/signin.html" style="text-decoration:none;color:black;" target="_blank">【登陆】</a>
<span><a href="/register.html" style="text-decoration:none;color:black;" target="_blank">【免费注册】</a></span> <%}else{
        %>欢迎您，<%=s_user_name%><span><a href="javascript:parent.location.href='/program/logout';" style="text-decoration:none;color:black;" target="_blank">【退出】</a></span><%}
 %>
</h1>
</div>
 </div>
 <div id="menu">
 <ul>


  <%
		int navListcCount =0;
		if(navList != null && navList.size() >0){
			navListcCount = navList.size();
			Map navMap = new Hashtable();
				for(int i = 4; i < 14; i ++){
					navMap = (Hashtable)navList.get(i);
					
					if(navMap != null && navMap.size() > 0){
						
						String link_url = navMap.get("link_url").toString();
						String nav_name = navMap.get("nav_name").toString();
						
						String opennew = navMap.get("opennew").toString();
						
						String target="_self";
						if(opennew.equals("0"))
						{
						  target  ="_blank";
						}
						else if(opennew.equals("1"))
                        {
						  target  ="_self";
						}
	 
	 
	  %>
 <li><a href="<%=link_url%>"  target="_blank"><%=nav_name%></a></li>	 
 <%
  						}
					
			}
	}
	  %>
  </ul>
 </div>
<div id="top_rmsou">
<div class="rmsou_text">
<p><span>热门搜索： </span>
  <%
 		 int listsize = 5;
		if(keywordList != null && keywordList.size() >0){
			if(keywordList.size()<listsize)
				listsize=keywordList.size();
			Map keyMap = new Hashtable();
				for(int i = 0; i < listsize; i ++){
					keyMap = (Hashtable)keywordList.get(i);
					
					if(keyMap != null && keyMap.size() > 0){
						String key_word = keyMap.get("key_word").toString();
						String key_type = keyMap.get("key_type").toString();
						
	  %>
<a style="text-decoration:none;color:black;" href="javascript:listsearch('<%=key_word%>');"><%=key_word%></a>&nbsp;&nbsp;&nbsp;
<%
	  						}
					
				}
		}
	  %>
	  
<p>
 </div>
<div class="rmsou_buttom">

<input type=text name='' id='q' value=''  style='height:21px;'/>
<input type=button onclick='zongsearch_goods();' name='' value='搜索'/>
</div> </div>
	<script type="text/javascript">
function listsearch(q){
				q = encodeURI(encodeURI(q));
				window.open("/goods_lists.html?q="+q);
			}
			function zongsearch_goods(){ 
			
			var q = trimTxt(document.getElementById("q").value); 
			 q = encodeURI(encodeURI(q));

				if(q != ""){
				window.open("/goods_lists.html?q="+q); 
				} else {
				alert("请输入关键字以查找您需要的信息！");
				}	
			}
			function trimTxt(txt)
			{
			   return txt.replace(/(^\s*)|(\s*$)/g, "");
			}

</script>
</div>
<div class="w990 wz">您的位置: <a href="/data/b2c">首页</a> > <a href="/program/member/index/index.jsp">会员中心</a></div>
  </body>
</html>
